package com.tfswx.jkgl.core.sjcc.impl;

import com.alibaba.fastjson.JSONObject;
import com.tfswx.jkgl.core.sjcc.ScclBase;
import org.springframework.stereotype.Component;

/**
 * @author Smile
 * @date 2021/12/12
 */
@Component
public class Mrz implements ScclBase {
    @Override
    public Object getValue(Object param) {
        try {
            if (param == null) {
                throw new RuntimeException("策略参数不能为空");
            }
            JSONObject obj = (JSONObject) param;
            if (!obj.containsKey("mrz")) {
                throw new RuntimeException("策略参数属性不正确");
            }
            return obj.get("mrz");
        } catch (RuntimeException e) {
            throw new RuntimeException("执行生成策略失败：" + e.getMessage());
        }
    }

    @Override
    public String getName() {
        return "默认值";
    }

    @Override
    public boolean sfxycs() {
        return true;
    }
}
